//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package com.mega.ycy.network;

import com.mega.ycy.network.KillMessage.MessageHandler;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraftforge.fml.common.network.NetworkRegistry;
import net.minecraftforge.fml.common.network.simpleimpl.IMessage;
import net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper;
import net.minecraftforge.fml.relauncher.Side;

public enum NetworkHandler {
    INSTANCE;

    private final SimpleNetworkWrapper channel;

    NetworkHandler() {
        this.channel = NetworkRegistry.INSTANCE.newSimpleChannel("ycy");
        this.channel.registerMessage(MessageHandler.class, KillMessage.class, 2, Side.CLIENT);
        this.channel.registerMessage(TimestopMessage.MessageHandler.class, TimestopMessage.class, 2, Side.CLIENT);
    }

    public void sendMessageToPlayer(IMessage msg, EntityPlayerMP player) {
        this.channel.sendTo(msg, player);
    }

    public void sendMessageToAll(IMessage msg) {
        this.channel.sendToAll(msg);
    }
}
